import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/layout'

Vue.use(Router)

const router = new Router({
  routes: [
    {
      path: '/404',
      component: () => import('@/views/error-page/404'),
      hidden: true
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/index')
    },
    {
      path: '/',
      component: Layout,
      redirect: '/helloWord',
      children: [{
        path: 'helloWord',
        name: 'HelloWorld',
        component: () => import('@/views/hello/HelloWorld')
      }]
    }
  ],
  mode: 'history' // 去除url连接中的#号
})

export default router
